/**
 * 工具栏图标数据
 */

export interface ToolIcon {
    name: string;
    svg: string;
    title: string;
}

export const toolIcons: Record<string, ToolIcon> = {
    select: {
        name: 'select',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007acc" stroke-width="2"><path d="M12 2l2 4.5 4.5.5-3 3.5.5 4.5-4-2.5-4 2.5.5-4.5-3-3.5 4.5-.5z"/><circle cx="12" cy="12" r="3"/></svg>',
        title: '选择工具'
    },
    resistor: {
        name: 'resistor',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#8B4513" stroke-width="2"><rect x="3" y="9" width="18" height="6" rx="1"/><line x1="6" y1="9" x2="6" y2="15"/><line x1="9" y1="9" x2="9" y2="15"/><line x1="15" y1="9" x2="15" y2="15"/><line x1="18" y1="9" x2="18" y2="15"/></svg>',
        title: '电阻'
    },
    capacitor: {
        name: 'capacitor',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#1E90FF" stroke-width="2"><line x1="6" y1="12" x2="18" y2="12"/><line x1="9" y1="8" x2="9" y2="16"/><line x1="15" y1="8" x2="15" y2="16"/></svg>',
        title: '电容'
    },
    wire: {
        name: 'wire',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#32CD32" stroke-width="2"><path d="M4 12h16" stroke-linecap="round"/><circle cx="8" cy="12" r="1" fill="#32CD32"/><circle cx="16" cy="12" r="1" fill="#32CD32"/></svg>',
        title: '导线'
    },
    voltage_source: {
        name: 'voltage_source',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#FF4500" stroke-width="2"><circle cx="12" cy="12" r="8"/><text x="12" y="16" text-anchor="middle" font-size="10" fill="#FF4500">V</text><line x1="4" y1="12" x2="8" y2="12"/><line x1="16" y1="12" x2="20" y2="12"/></svg>',
        title: '电压源'
    },
    current_source: {
        name: 'current_source',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#32CD32" stroke-width="2"><circle cx="12" cy="12" r="8"/><text x="12" y="16" text-anchor="middle" font-size="10" fill="#32CD32">I</text><line x1="4" y1="12" x2="8" y2="12"/><line x1="16" y1="12" x2="20" y2="12"/></svg>',
        title: '电流源'
    },
    connection_straight: {
        name: 'connection_straight',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007acc" stroke-width="2"><line x1="4" y1="12" x2="20" y2="12" stroke-dasharray="5,3"/></svg>',
        title: '直线连接'
    },
    connection_bezier: {
        name: 'connection_bezier',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007acc" stroke-width="2"><path d="M4 12 Q12 4 20 12" stroke-dasharray="5,3" fill="none"/></svg>',
        title: '贝塞尔曲线连接'
    },
    connection_handdrawn: {
        name: 'connection_handdrawn',
        svg: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007acc" stroke-width="2.5" stroke-linecap="round"><path d="M4 12 Q8 10 12 12 T20 12" stroke-dasharray="4,2" fill="none"/></svg>',
        title: '手绘风格连接'
    }
};

export const toolSeparator = '<div class="tool-separator" style="width: 1px; height: 24px; background-color: #e0e0e0; margin: 0 8px;"></div>';